<template>
    <div id="refund">
        <!-- ----------------没有订单页面 --------------- -->
        <div id="shopping-empty" :style="{height:height+'px'}" type="1" v-if="showTime">
		    <img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/orders_empty.png" class="empty-bg" />
		    <span>还没有相关订单呢～</span>
		    <input type="button" class="goHome" value="今日推荐" @click="gohome()" />
	    </div>
        <!-- ---------------- 订单列表 --------------- -->
        <div class="allDiv" v-for="x in list">
			<div class="two" style="background:white;">
				<div class="contest" @click="goBussiness(x.id)">
					<ul class="left">
						<li class="text"><img :src="x.shopInfo.logo" style="width:.4rem;height:.4rem;border-radius:50%;margin-right:.1rem;">{{x.shopInfo.name}}<img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/more@2x.png" style="width: 0.14rem;height: 0.26rem;margin-left: .12rem;"></li>
					</ul>
				</div>
				<div class="cutDetail">
					<ul class="photo">
						<li><img :src="x.proInfo.thumb"></li>
					</ul>
					<ul class="cut-right">
						<li class="one">{{x.proInfo.title}}</li>
						<li class="two">{{x.proInfo.spec}}</li>
						<li class="three">
							<span class="now">当前价</span>
							<span class="icon" >¥</span>
							<span class="money">{{x.proInfo.minPrice}}</span>&nbsp;&nbsp;
							<span class="before" style="text-decoration: line-through; font-size:.24rem; color:#969696">¥{{x.proInfo.maxPrice}}</span>
						</li>
					</ul>
				</div>
				<div class="cut-btn">
					<div>
						<span style="font-size: .26rem;display: block;color: #9948c3;margin-left: .24rem;">{{x.byType.msg}}</span>
					</div>
					<div class="btn">
						<button @click="godiscuss($event)" :orderid="x.orderid">查看详情</button>
					</div>
				</div>
                </div>
		</div>

    </div>
</template>
<script>
    import config from "../config/config.js";
    import share from "../share/share.js";
    import MtaH5 from 'mta-h5-analysis';
    export default{
        data(){
            return{
                showTime:false,
                list:[]
            }
        },
        methods:{
            godiscuss($event){
                var orderid=$event.currentTarget.getAttribute('orderid');
                this.$router.push("/allorder/flow/"+orderid)
            },
            gohome(){
                this.$router.push("/home/index/00")
            },
			gerRefunOrder(){
                var value=JSON.stringify({"page":"1","type":"G","token":localStorage.getItem('token')}),
                    key=demo(value);
                axios.post('/Home/Order/GetOrderInfo',{
                        value:value,
                        key:key
                },config)
                    .then(function(response) {
						if(response.data.data.data==''){
							this.showTime=true;
						}else{
                            this.showTime=false;
						    this.list=response.data.data.data
						}
                    }.bind(this))
                    .catch(function (error) {
                        console.log(error);
                    });
			},
            goBussiness(id){
                this.$router.push('/business/'+id)
            },
        },
		activated(){
            this.gerRefunOrder();
            share({});
            MtaH5.init({
                "sid":'500594815',
                "cid":'500595819',
                "autoReport":0,
                "senseHash":0,
                "senseQuery":0,
                "performanceMonitor":0,
                "ignoreParams":[]
            });
            MtaH5.pgv();
		},
		deactivated(){
            this.$destroy(true);
		}
    }
</script>
<style>
    
</style>